//
//  HomeSleepInfoView.m
//  Ginix
//
//  Created by 冯志强 on 2025/2/20.
//

#import "HomeSleepInfoView.h"

@interface HomeSleepInfoView()
@property (nonatomic,strong) UILabel * timeLabel;
@property (nonatomic,strong) UILabel * infoLabel;
@end

@implementation HomeSleepInfoView

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        [self setSubViewLayout];
    }
    return self;
}

-(void)setSubViewLayout{
    
    [self addSubview:self.timeLabel];
    [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(@0);
        make.height.mas_offset(26 * FMScaleX);
    }];
    [self addSubview:self.infoLabel];
    [_infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.left.right.equalTo(@0);
        make.height.mas_offset(22 * FMScaleX);
    }];
}

-(UILabel *)timeLabel{
    
    if (!_timeLabel) {
        _timeLabel = [[UILabel alloc]init];
        _timeLabel.font = Regular(20);
        _timeLabel.textColor = UIColor.blackColor;
        _timeLabel.text = @"--";
        _timeLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _timeLabel;
}
-(UILabel *)infoLabel{
    
    if (!_infoLabel) {
        _infoLabel = [[UILabel alloc]init];
        _infoLabel.font = Regular(16);
        _infoLabel.textColor = RDRGB(0x666666);
        _infoLabel.text = @"总时长";
        _infoLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _infoLabel;
}
@end
